/**
 * 对应教师端模版模块
 */



package xiangmu.schoolpaper.service.impl.teacher;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import xiangmu.schoolpaper.mapper.DictTemplateTypeMapper;
import xiangmu.schoolpaper.mapper.teacher.TemplateTypesMapper;
import xiangmu.schoolpaper.pojo.entity.DictTemplateType;
import xiangmu.schoolpaper.service.teacher.TemplateTypesService;

import java.util.List;
import java.util.stream.Collectors;



@Service
public class TemplateTypesServiceImpl implements TemplateTypesService {


    @Autowired
    private DictTemplateTypeMapper dictTemplateTypeMapper;


    public List<String> getAllTemplateTypes() {
        // 查询所有未删除的模版类型
        List<DictTemplateType> list = dictTemplateTypeMapper.selectList(
                new QueryWrapper<DictTemplateType>().eq("del_flag", 1)
        );

        // 只要模版类型名称
        return list.stream().map(DictTemplateType::getTemplateTypeName).collect(Collectors.toList());


    }

}
